//
//  FloatTextFieldViewController.m
//  myDemo2
//
//  Created by wuxueying on 14-4-29.
//
//

#import "FloatTextFieldViewController.h"
#import "JVFloatLabeledTextField.h"

const static CGFloat kJVFieldHeight = 100;
const static CGFloat kJVFieldHMargin = 10.0f;

const static CGFloat kJVFieldFontSize = 16.0f;

const static CGFloat kJVFieldFloatingLabelFontSize = 11.0f;

@interface FloatTextFieldViewController ()
@property (weak, nonatomic) IBOutlet JVFloatLabeledTextField *nameTextField;
@end
@implementation FloatTextFieldViewController

- (void)viewDidLoad
{
    [super viewDidLoad];
    [_nameTextField becomeFirstResponder];
    CGFloat topOffset = [[UIApplication sharedApplication] statusBarFrame].size.height + self.navigationController.navigationBar.frame.size.height;
    UIColor *floatingLabelColor = [UIColor grayColor];
    _nameTextField.frame =
     CGRectMake(kJVFieldHMargin, topOffset, self.view.frame.size.width - 2 * kJVFieldHMargin, kJVFieldHeight);
    _nameTextField.placeholder = NSLocalizedString(@"Title", @"");
    _nameTextField.font = [UIFont systemFontOfSize:kJVFieldFontSize];
    _nameTextField.floatingLabel.font = [UIFont boldSystemFontOfSize:kJVFieldFloatingLabelFontSize];
    _nameTextField.floatingLabelTextColor = floatingLabelColor;
    _nameTextField.clearButtonMode = UITextFieldViewModeWhileEditing;
}

@end
